home *** CD-ROM | disk | FTP | other *** search
/ Aminet 21 / Aminet 21 (1997)(GTI - Schatztruhe)[!][Oct 1997].iso / Aminet / util / boot / ffppatch.lha / ffppatch.readme < prev    next >
Encoding:
Text File  |  1997-07-20  |  6.5 KB  |  213 lines

  1. Short:    mathffp.library FPU speedup patch 1.5b
  2. Author:   Jess Sosnoski (at the below address!!!)
  3. Uploader: starblaz@postoffice.ptd.net
  4. Type:     util/boot
  5. Version:  1.4beta
  6. Requires: kick 2.04+?, an 020+, and a 68881/2 FPU.
  7. Long:
  8.  
  9. FFPpatch 1.5beta © 1997 Jess Sosnoski
  10. Tieee function © 1995 Martin Berndt
  11.  
  12. DESCRIPTION:
  13. -----------
  14. This is a program that patches some functions of the mathffp.library
  15. to use 68881/2 instructions, thus squeezing out a bit more speed.
  16. (I hope!)
  17.  
  18. This is also the first speedup patch I ever attempted to write! :)
  19.  
  20. Works on an '040 or '060 too!
  21. (does not use any FPU trig functions)
  22.  
  23. DISCLAIMER:
  24. ----------
  25. Use this program at your own risk!
  26. I assume no responsibility or liability for problem(s) and/or damage(s)
  27. that occur by the use, modification, and/or existence of this product,
  28. and/or its parts in any form.
  29.  
  30.  But if it don't work right, or slows things down, don't be afraid
  31.  to send me email...or even send some email if it makes your system
  32.  outprocess a cray (yeah, right)
  33.  
  34. Anywayz tho...the following functions are patched, and here's the
  35. speed differences I got with a test program I wrote:
  36.  
  37. *NOTE* The test program must call float() a lot, because when I re-enabled
  38. the SPFloat() patch, the test program ran one hell of a lot faster.
  39.  
  40. I've included the results before I re-enabled the float() patch so you
  41. can see what differences there were.
  42.  
  43. Function    PATCHED        Not_Patched  
  44. -------------------------------------------
  45. SPAbs        2.21        12.02      
  46. SPNeg        2.16        12.20
  47. SPAdd        5.18        18.91
  48. SPSub         5.17        17.78
  49. SPMul        5.18        20.70
  50. SPDiv        5.26        20.96
  51. SPFloat        2.13        11.94
  52. SPFix        2.96        14.26        
  53. SPFloor        2.16        15.13
  54. SPCeil        4.75        27.41
  55.  
  56. (SPTst and SPCmp are also patched)
  57. Hmmm....very interesting.....that's why this patch is a beta :)
  58.  
  59. Your results will likely differ.
  60. (The testprogram isn't the best in the world)
  61.  
  62. INSTALLATION:
  63. ------------
  64. Copy it to your c: directory or wherever you like.
  65. You can add the line run <>NIL: ffppatch to your startup-sequence, or
  66. user-startup.  You can give it an icon and put it in WBstartup.
  67. You can basically put it anywhere :)
  68. (I have mine a little after setpatch in my startup-sequence)
  69.  
  70. USAGE:
  71. -----
  72. run <>NIL: ffppatch
  73.  
  74. OUTPUT:
  75. ------
  76. None...as I didn't feel like figuring out how to to text output
  77. in assembly.
  78. Although, if you don't have the right versions of the required libraries,
  79. it will exit with a returncode of 20.
  80.  
  81. REMOVAL:
  82. -------
  83. sorry....once it's in...it stays in!
  84. (didn't I hear Al Bundy say that to Peg once...hmmm....)
  85.  
  86. CAVEATS:
  87. -------
  88. This patch is experimental, so, don't expect any miracles.
  89.  
  90. Opens mathffp.library, and never closes it.
  91.  
  92. Also...not a whole hell of a lot of programs use mathffp.library, but those
  93. which do may benefit from a little speedup.
  94. (although some garshneblankers, the akJFIF, akLJPG, and akPNG
  95.  datatypes use it)
  96.  
  97. There exists a 68881 card for 68000 owners, but, as I found out via
  98. email, does not access the FPU in the same way that an 020+ would.
  99. I did not include any special code to support this, so it is likely that
  100. this patch may not do anything at all on that type of setup.
  101. (Although, if someone would like to let me know if it does...email me!)
  102.  
  103. NOTES:
  104. -----
  105. mathffp.library is in your Kickstart ROM...you won't find it in libs.
  106. I've noticed that 040 owners are getting horrible results with
  107. a few functions...I'll have to figure something out about it....hmmm...
  108.  
  109.  
  110. FFPTEST
  111. -------
  112. Here it is!   Just type ffptest and it will dump out the results.
  113. It disables multitasking while running.  It does actually give results
  114. with an 040 or 060.  (though the numbers are quite small)
  115.  
  116. The best thing you can do is go into the bootshell, with 
  117. ALL CPU CACHES OFF--leaving them on can give different results with or
  118. without ffppatch when run multiple times (I found this out the hard way)
  119. (trust me, you WILL see a difference)
  120. Note: the testprogram is written in PCQ pascal and may be a bit dodgy.
  121.  
  122.  
  123. cpu NOCACHE    
  124. ffptest
  125.  
  126. run <>NIL: ffppatch
  127. ffptest
  128.  
  129. Then you will see a difference.
  130.  
  131. HISTORY:
  132. -------
  133. 1.0     First Release
  134.  
  135. 1.1    Now closes mathffp.library when mathtrans.lib v40 can't be opened
  136.     Optimized spmul, spdiv, spabs, spneg, spflt, spfloor and squeezed
  137.     a couple more clock cycles out.
  138.     (spadd and spsub optimized too, but disabled cuz they were
  139.      slower for some reason :( )
  140.     Removed SPFix patch...it was slower :(
  141.  
  142. 1.2    Due to my rewriting of ffptest (included), I was able to more
  143.     accurately test speed of calls to mathffp.library.  
  144.     I found out everything went faster in the first place :)
  145.     Re-enabled everything.
  146.  
  147. 1.3    Contacted Martin Berndt, author of fmath40x.lha, and asked
  148.     about the Fieee and Tieee functions....so, he emailed me the
  149.     source...and I removed the mathtrans.library requirement and
  150.     put the functions directly into the patch program, making it
  151.     faster :)
  152.  
  153. 1.4    Longword aligned all patches.
  154.     Changed spabs, spneg and spflt functions to not use fpu...
  155.     they didn't have to do all that work, and were probably horribly
  156.      slower before.
  157.     (worst case..they're probably the same speed as the stock library now
  158.      ..but, one of them can likely be inlined directly into the
  159.        jumptable in some future version to save a clock cycle or two)
  160.     Changed the SPFieee function to a faster one.
  161.     Changed the SPFix function to something more like the original.
  162.  
  163. 1.5    Inlined the SPFieee function whereever possible shaving off more
  164.     clock cycles.
  165.     Included Dave Jones' optimized SPTst and SPCmp functions!
  166.     
  167. FUTURE:
  168. ------
  169. Make this doc file a bit more presentable, and maybe leave it as plain
  170. text without Amigaguide OR HTML just for kicks.
  171. Write a more accurate test program, and maybe include it in the archive.
  172.  
  173. Make a GOOD ffptest speedtest program. (in assembly)
  174.  
  175. Maybe add command line-arguments to turn on/off selected patches.
  176.  
  177. Make the patch exit, instead of hanging around.
  178.  
  179. One word: APATCH (if this patch turns out to work as I'd like it to)
  180.  
  181. THANKS TO:
  182. ---------
  183. Martin Berndt...for sending me the sourcecode to Tieee and Fieee
  184. functions from his fmath40x mathtrans.library.
  185.  
  186. Adam "DC1" Polosnik for ideas, help with sourcecode, and APATCH!
  187.  
  188. Dave "Termy" Jones, for help, ideas, optimized functions,  and StreamLineOS 2!
  189.  
  190. Everyone who sent me emails, praise, and complaints....your input
  191. was greatly appreciated!!!!
  192.  
  193. BUGS:
  194. ----
  195. Hmmm...what would Tom say, ohyeah, um....possibly.
  196. Crummy speedtest program.
  197.  
  198. AUTHOR:
  199. ------
  200. Jess Sosnoski
  201. 651 Hillside Drive
  202. Mount Carmel, PA 17851-2463
  203. USA
  204.  
  205. starblaz@postoffice.ptd.net
  206. http://home.ptd.net/~starblaz
  207.  
  208. IRC nick: starblaz
  209. On: galaxynet (#amichat), beyondirc (#styx, #amirc), dalnet (#nin ,#c-64)
  210.  
  211. Emails, gifts, money, food, cigarettes, Amiga4060T's will all be
  212. gladly accepted.
  213.